import React ,{ComponentType} from 'react'
import { useNavigate ,useLocation ,useParams } from 'react-router-dom';

function widthRoute(Com:ComponentType<any>) {
    return (props:any) =>{
        const Navigate = useNavigate();
        const Location = useLocation();
        const Params = useParams();

        return (
            <Com {...props} route = {{Navigate,Location,Params}}></Com>
        )
    }
}

export default widthRoute